class PanelBase extends eui.Component {

	public constructor() {
		super();
	}


	// 关闭按钮
	public btnClose: eui.Label;
	private panelCommon: eui.Panel;
	protected commonPanel: Panel;


	/**
	 * 在将显示对象直接添加到舞台显示列表或将包含显示对象的子树添加至舞台显示列表中时调度。
	 */
	protected createChildren() {
		super.createChildren();
		if (this.btnClose) {
			this.btnClose.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTapclose, this);
		}
		if (this.panelCommon) {
			this.commonPanel = new Panel(this.panelCommon);
			this.panelCommon["btnClose"].addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTapcloseCommon, this);
		}
	}


	/**
	 * 关闭窗口
	 */
	protected onTapclose() {
		this.doOnTapclose(this.btnClose);
	}

	protected onTapcloseCommon() {
		this.doOnTapclose(this.panelCommon["btnClose"]);
	}

	private doOnTapclose(e) {
		SceneManager.ins.popScene();
	}
}